﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using LogisticsDAL;
using Model;
using System.Data.SqlClient;

namespace LogisticsBLL
{
  
    public class UserBLL
    {
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="wherelist"></param>
        /// <param name="pramlist"></param>
        /// <returns></returns>
        public  DataTable UserSelet(string txtName, string phone, string checktime, string checkDateEnd,
        string Tsex, string delet, string acount, string Email, string roles, string afterTime, string AfterDateEnd,
         int pageIndex, int pageSzie, out int Count)
        {
            UserDAL us = new UserDAL();
            DataTable li=us.GvRead(txtName,phone,checktime,checkDateEnd,
            Tsex, delet, acount, Email, roles, afterTime,AfterDateEnd,
            pageIndex, pageSzie, out Count);
            return li;
        }

        /// <summary>
        /// 删除用户信息
        /// </summary>
        /// <param name="uid"></param>
        /// <returns></returns>
        public static int dels(int uid)
        {
            return UserDAL.del(uid);
        }

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="Acount"></param>
        /// <param name="phones"></param>
        /// <param name="email"></param>
        /// <param name="roleid"></param>
        /// <param name="checktime"></param>
        /// <param name="isdelete"></param>
        /// <param name="aftertime"></param>
        /// <param name="uid"></param>
        /// <returns></returns>
        public static int upd(string UserName, string Acount,string Sex, string phones, string email, string roleid, int isdelete, int uid)
        {
            return UserDAL.updat(UserName,Acount,Sex, phones, email, roleid, isdelete, uid);
        }

        public static SqlDataReader droplie()
        {
            return UserDAL.doplie();
        }

        /// <summary>
        /// 添加用户
        /// </summary>
        /// <param name="uname"></param>
        /// <param name="sex"></param>
        /// <param name="acount"></param>
        /// <param name="phone"></param>
        /// <param name="pwd"></param>
        /// <param name="email"></param>
        /// <param name="roleid"></param>
        /// <param name="isdel"></param>
        /// <returns></returns>
        public static int AddUse(string uname, string sex, string acount, string phone, string pwd, string email, int roleid, string isdel)
        {
            return UserDAL.Adduser(uname, sex, acount, phone, pwd, email, roleid, isdel);
        }

        /// <summary>
        /// 修改密码
        /// </summary>
        public static int uppwd(string paswod, int uid)
        {
            return UserDAL.Uppwd(paswod, uid);
        }
        public static object panduan(int uid)
        {

            return UserDAL.selpwd(uid);
        }


        /// <summary>
        /// 显示用户信息
        /// </summary>
        /// <param name="userid"></param>
        /// <returns></returns>
        public  Users usertab(int userid)
        {

            return UserDAL.usertab(userid);
        }

        public SqlDataReader readDDl()
        {
            UserDAL ual = new UserDAL();
            return ual.read();
        }

        public List<SysLogs> BindSysLog(SysLogs log, int pageindex, int pagesize, out int count)
        {
            UserDAL ud = new UserDAL();
            return ud.sysBind(log, pageindex, pagesize, out count);
        }

        public Users UserBind(int UserID)
        {
            UserDAL uda = new UserDAL();
            return uda.BindUser(UserID);
        }

        public int PDcunzaName(string Name)
        {
            UserDAL ud = new UserDAL();
            return ud.PDname(Name);
            
        }


        public int PDcunzaAccount(string Account)
        {
            UserDAL ud = new UserDAL();
            return ud.PDAccount(Account);
           

        }

    }
}
